package mytest.com.myapplication;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import javax.inject.Inject;

/**
 * Created by 王家宝 on 2017/11/7.
 * Email:639586819@qq.com
 * Tel:18241150668
 */

public class SecondActivity extends AppCompatActivity {

    @Inject
    Cat mCat1;

    @Inject
    Cat mCat2;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AnimalsComponent animalsComponent = DaggerAnimalsComponent.builder().
                animalsMoudle(new AnimalsMoudle(this)).build();
        animalsComponent.inject(this);
        Log.d("SingletonTest", "mCat1:" + mCat1);
        Log.d("SingletonTest", "mCat1:" + mCat2);
    }

}
